#include "dbreader.h"

#include <QMessageBox>

DBReader::DBReader()
{
    sett = new QSettings("Smart Softwares", "Smart Prarmacy");
}

void DBReader::setDbPassword(QString str)
{
    dbPassword = str;
    sett->setValue("dbPassword", str);
}


void DBReader::setDbServer(QString str)
{
    dbServer = str;
    sett->setValue("dbServer", str);
}

void DBReader::setDbUserName(QString str)
{
    dbUserName = str;
    sett->setValue("dbUserName", str);
}

void DBReader::serDbName(QString str)
{
    dbName = str;
    sett->setValue("dbName", str);
}

QString DBReader::getDbName()
{
    dbName = sett->value("dbName", "pharmacy").toString();
    return dbName;
}

QString DBReader::getDbPassword()
{
    dbPassword = sett->value("dbPassword", "root").toString();
    return dbPassword;
}

QString DBReader::getDbServer()
{
    dbServer = sett->value("dbServer", "localhost").toString();
    return dbServer;
}

QString DBReader::getDbUserName()
{
    dbUserName = sett->value("dbUserName", "root").toString();
    return dbUserName;
}
